package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.util.PermissionName;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.wolfcode.crm.query.ProductStockQuery;
import cn.wolfcode.crm.service.IProductStockService;
import cn.wolfcode.crm.util.PageResult;

@Controller
@RequestMapping("productstock")
public class ProductStockController {
	@Autowired
	private IProductStockService productstockService;
	
	@RequestMapping("")
    public String index(){
        return "productstock/list";
    }
	
	
	@RequiresPermissions("productstock:list")
	@PermissionName("即时库存报表")
	@RequestMapping("list")
	@ResponseBody
	public PageResult list(ProductStockQuery qo) {
		return productstockService.query(qo);
	}
}
